﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<cludg.Domain.Content.Stories.Offer>" %>
<%@ Import Namespace="cludg.Domain.Content.Stories" %>
<%@ Import Namespace="cludg.Web.Core.RenderHelpers" %>
<%@ Import Namespace="cludg.Web.RenderHelpers" %>
<div class="offer-details">
	<div class="title">
		<h1>
			<%: string.IsNullOrWhiteSpace(Model.Title) ? "Без заголовка" : Model.Title%></h1>
	</div>
	<% Html.StorySubject(Model.Subject); %>
	<div class="display-label">
		Дата создания:
		<%: Html.RenderDateTime(Model.CreationTime)%>
	</div>
	<div class="author">
		Предложил:
		<% if (Model.Author != null)
	 { %>
		<%:Html.ProfileLink(Model.Author)%>
		<%}
	 else
	 {%>
		<%:Model.AnonymouseAuthorName%>
		<%
			}%>
	</div>
	<div class="display-label">
		Комментарий:
		<%: Model.Comment%>
	</div>
	<% if (Model.State == Offer.OfferState.Approved)
	{ %>
	<p>
		Принята
		<% if (Model.OfferedBy != null)
	 { %>
		пользователем
		<%: Html.ProfileLink(Model.OfferedBy)%>
		<% } %>
		<%: Html.RenderDateTime(Model.OfferingTime) %>
		<br />
		<%: Html.StoryLink("Показать", Model.ApprovedStoryId)%>
	</p>
	<% } %>
	<% if (Model.State == Offer.OfferState.Declined)
	{ %>
	<p>
		Отклонена
		<% if (Model.OfferedBy != null)
	 { %>
		пользователем
		<%: Html.ProfileLink(Model.OfferedBy)%>
		<% } %>
		<%: Html.RenderDateTime(Model.OfferingTime) %>
	</p>
	<% } %>
</div>
